import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import("../views/login/login.vue"),
  },

  {
    path: '/home',
    name: 'home',
    component: () => import("../views/home.vue"),
    redirect: "/home/xinwen",
    children: [
      // 新闻资讯

      {
        path: "xinwen",
        name: "xinwen",
        meta: {
          title: "管理资讯",
          icon1: "el-icon-user-solid",
          names: "新增资讯",
          icon2: "el-icon-s-operation",
        },
        component: () => import('../views/xinwen/xinwen.vue'),
      },

      {
        path: "rolelist",
        name: "rolelist",
        meta: {
          title: "加入我们",
          icon1: "el-icon-s-tools",
          names: "权限列表",
          icon2: "el-icon-s-tools"
        },
        component: () => import("../views/rolelist/rolelist.vue")
      },
      // 商品管理
      {
        path: "goodsList",
        name: "goodsList",
        meta: {
          title: "官网配置",
          icon1: "el-icon-s-goods",
          names: "商品列表",
          icon2: "el-icon-s-goods",
        },
        component: () => import("../views/goodsList/goodsList.vue")
      },
      // 订单管理
      {
        path: "orderList",
        name: "orderList",
        meta: {
          title: "历程管理",
          icon1: "el-icon-s-order",
          names: "历程信息",
          icon2: "el-icon-s-order",
          names2: "新增历程",
          icon3: "el-icon-s-order",
        },
        component: () => import("../views/orderList/orderList.vue"),
      },
      // 产品方案
      {
        path: "product",
        name: "product",
        meta: {
          title: "产品方案",
          icon1: "el-icon-s-marketing",
          names: "产品信息",
          icon2: "el-icon-s-marketing",
          names2: "新增产品",
          icon3: "el-icon-s-marketing"
        },
        component: () => import("../views/product/product.vue"),
      },
      {
        path: "hezuo",
        name: "dataList",
        meta: {
          title: "合作伙伴",
          icon1: "el-icon-s-marketing",
          names: "伙伴信息",
          icon2: "el-icon-s-marketing",
          names2: "合作伙伴",
          icon3: "el-icon-s-marketing"
        },
        component: () => import("../views/huoban/HomeView.vue"),
      },
      {
        path: "guanyu",
        name: "dataList",
        meta: {
          title: "关于我们",
          icon1: "el-icon-s-marketing",
          names: "数据列表",
          icon2: "el-icon-s-marketing",
        },
        component: () => import("../views/guanyu/guanyu.vue"),
      },
      {
        path: "banner",
        name: "dataList",
        meta: {
          title: "轮播图",
          icon1: "el-icon-s-marketing",
          names: "轮播图设置",
          icon2: "el-icon-s-marketing",
          names2: "轮播图展示",
          icon3: "el-icon-s-marketing",
        },
        component: () => import("../views/banner/banner.vue"),

      }
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router
